home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / Xconq 7.0d16 / Xconq 7.0d16 src / src / unit.h < prev    next >
Encoding:
Text File  |  1993-12-20  |  10.8 KB  |  94 lines  |  [TEXT/MPS ]

  1.  struct a_task *tasks;      /* pointer to chain of sequential tasks */
  2.     short boss;                /* id of who gives us commands */
  3.     short deputy;              /* id of who inherits the plan if we die */
  4.     short subords;             /* id of a unit being controlled by this one */
  5.     short nextpeer;            /* who we like to hang out with */
  6.     Action lastaction;         /* a copy of the last action attempted */
  7.     short lastresult;          /* that action's outcome */
  8.     short alarmmask;           /* bit vector of alarms currently set */
  9.     short alarms;              /* bit vector of alarms that have triggered */
  10.     short alarmdata[4];        /* data concerning the alarms */
  11.     short x, y, radius;        /* dimensions of area being defended */
  12.     short protectee;           /* id of unit being protected */
  13.     short waitingfortransport;
  14.     short aicontrol;
  15. } Plan;
  16.  
  17. /* Global unit variables. */
  18.  
  19. extern Unit *unitlist;
  20. extern Unit *tmpunit;
  21.  
  22. extern int numunits;
  23.  
  24. /* Declarations of unit-related functions. */
  25.  
  26. void init_units();
  27. int type_can_occupy();
  28. int can_occupy();
  29. int can_carry();
  30. int enter_hex();
  31. void leave_hex();
  32. void enter_transport();
  33. void leave_transport();
  34. int embark_unit();
  35. void flush_dead_units();
  36. void sort_units();
  37. int low_supplies();
  38. char *summarize_units();
  39. Unit *create_unit PROTO((int u, int makeplan));
  40. Unit *find_unit();
  41. int find_unit_char();
  42. int find_unit_name();
  43. char *random_unit_name();
  44. char *unit_handle();
  45. char *short_unit_handle();
  46. char *utype_name_n();
  47. char *unit_desig();
  48. Unit *first_unit();
  49. Unit *next_unit();
  50. void insert_unit();
  51. void delete_unit();
  52. int evaluate_hex();
  53. int maximize_worth();
  54.  
  55. Unit *find_next_unit();
  56. Unit *find_prev_unit();
  57. Unit *find_next_actor();
  58. Unit *find_prev_actor();
  59.  
  60. char *actorstate_desig();
  61.  
  62. extern enum sortkeys tmpsortkeys[];
  63.  
  64. UnitVector *make_unit_vector();
  65. UnitVector *add_unit_to_vector();
  66.  
  67. /* (following should be elsewhere?) */
  68.  
  69. void free_plan();
  70. char *plan_desig();
  71.  
  72. void init_tasks();
  73. Task *create_task();
  74. void free_task();
  75. char *task_desig();
  76.  
  77. extern ActionDefn actiondefns[];
  78.  
  79. extern GoalDefn goaldefns[];
  80.  
  81. extern TaskDefn taskdefns[];
  82.  
  83. extern char *plantypenames[];
  84.  
  85. Action *create_action();
  86. char *action_desig();
  87.  
  88. /* Declare all the action functions. */
  89.  
  90. #undef  DEF_ACTION
  91. #define DEF_ACTION(code,name,args,FN,doc) int FN();
  92.  
  93. #include "action.def"
  94.